<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>添加大物品出登记</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet"
			href="<%=request.getContextPath()%>/css/common.css" type="text/css" />
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/N13FormValidation-2.js"></script>	
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/interface/registerLargeItemTypeAction.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/engine.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/util.js'></script>
		<script type="text/javascript">
		window.onload=init;
		function init(){
			setSelectionList();
		}
		/**
		* 给apart select框赋值的
		*/
				function setSelectionList() {
					registerLargeItemTypeAction.getAllRegisterLargeItemType(ritCallBack);
				}
				var ritCallBack = function setList(ritList)//回调函数
				{				
					var s=$("selections");
					DWRUtil.removeAllOptions(s); 
					s.options[0] = new Option("请选择保修物品类型",'0');
					for ( var i = 1; i < ritList.length+1; i++) {
						var opt = new Option(ritList[i-1].registerlargeitemtypename,
								ritList[i-1].registerlargeitemtypeid);
						s.options[i] = opt;
					}
				}
				/**
				* 公寓select框change函数
				*/
				function selectChange(){
					
				}
				
				function checkOnSubmit(){
					var studentNo=window.top.frames['apt'].frames['maintain'].document.getElementById("student_info").value;
					document.getElementById("studentno").value=studentNo;
					var selectedIndex=dwr.util.getValue("selections");
					if(""==studentNo){
						alert("请输入学号！！");
						return false;
					}else if(0==selectedIndex){
						alert("请选择物品类型！！");
						return false;
					}else{
						return true;
					}
				}
		</script>
	</head>

	<body>
		<div id="page_container">
			<jsp:include page="registerinfonav.jsp"></jsp:include>
			<h2>
				大物品出登记
			</h2>
			<!-- 引入学生基本信息页面 -->
			<s:form id="mainform"
				action="registerinfo/insertregisterlargeitemout.action" method="post"
				theme="simple" onsubmit="return checkOnSubmit()">
				<s:hidden id="studentno" name="rli.studentno" />
				<table class="table_common">							
					<tr>
						<td class="td_left">
							*大物品类型：
						</td>
						<td class="td_right">
							<select  class="common_select" id="selections" name="rli.registerlargeitemtype.registerlargeitemtypeid" style="width: 120"></select>						
						</td>
					</tr>
					<!-- 
					<tr>
						<td class="td_left">
							大物品出楼时间：
						</td>
						<td class="td_right">
							<s:datetimepicker name="rli.registerlargeitemouttime"
								label="Format (yyyy-MM-dd)" displayFormat="yyyy-MM-dd hh:mm" />
						</td>
					</tr>
					<tr>
						<td class="td_left">
							大物品进楼时间：
						</td>
						<td class="td_right">
							<s:datetimepicker name="rli.registerlargeitemintime"
								label="Format (yyyy-MM-dd)" displayFormat="yyyy-MM-dd hh:mm" />

						</td>
					</tr>
					 -->
					<tr>
						<td class="td_left">
							备注：
						</td>
						<td class="td_right">
							<s:textarea name="rli.remarks" cols="30"></s:textarea>
						</td>
					</tr>
					<tr class="table_submit">
						<td colspan="2">
							<s:submit cssClass="common_button" value="提交" />
						</td>
					</tr>
				</table>
			</s:form>
			<script type="text/javascript">
			</script>
		</div>
	</body>
</html>